package com.horay.springbootdemo.jwt.customer.service.impl;

import com.horay.springbootdemo.jwt.common.model.Customer;
import com.horay.springbootdemo.jwt.customer.service.CustomerService;
import org.springframework.stereotype.Service;

import java.util.Optional;

/**
 * 顾客业务实现类
 *
 * @author heyingcheng
 * @date 2019/10/4 12:24
 */
@Service
public class CustomerServiceImpl implements CustomerService {

    @Override
    public Optional<Customer> findById(String id) {
        if (CUSTOMER_ID.equalsIgnoreCase(id)) {
            Customer customer = new Customer();
            customer.setId(id);
            customer.setPassword(CUSTOMER_PASSWORD);
            customer.setUsername("系统管理员");
            return Optional.of(customer);
        }
        return Optional.empty();
    }

}
